﻿@model IEnumerable<Alumnado.Models.Alumno>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Inscribir Alumno", "Create")
</p>

<form action="@Url.Action("ListaFiltrada", "Materia")" method="post">
        <label>Filtrar por:
            <select name="materia">
                @foreach (var item in @ViewBag.lista) {
                    <option value="@item">@item</option>
                }
            </select>
            <input type="submit" value="Filtrar" />
        </label>
</form>

<form action="@Url.Action("FiltradoCurso")" method="post">
    <label>
        <span>Filtrar Por Curso:</span>
        <input type="text" name="curso" />
        <input type="submit" value="Filtrar" />
    </label>
</form>
<table border="1">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.nombre)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.apellido)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.dni)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.curso)
        </th>
        <th>operaciones</th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.nombre)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.apellido)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.dni)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.curso)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.id }) |
            @Html.ActionLink("Details", "Details", new { id=item.id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.id })
        </td>
    </tr>
}

</table>
